home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 8 / Eagles_Nest_Mac_Collection_Disc_8.TOAST / Developer Environments / MacApp301#8 / MacApp 3.0.1• / Release Notes / MacApp 3.0.1 Bug Doc < prev    next >
Encoding:
Text File  |  1992-10-09  |  30.4 KB  |  939 lines  |  [TEXT/ttxt]

  1.                               
  2. This document is a technical addendum to the release notes
  3. included with  MacApp 3.0.1 and will be periodically
  4. updated. The latest version of this document can be found on
  5. AppleLink at the following path:
  6.    Developer Support:
  7.        Developer Talk:
  8.            Macintosh Development Tool Discussions:
  9.                MacApp Discussion:
  10.                   MacApp Technical Updates:
  11. Note that the MacApp AppleLink discussion archives, included
  12. with ETO, are an excellent additional source of MacApp
  13. programming information.
  14.  
  15. What's New or Changed:
  16.      10/9/92:  
  17.                              Section I:     #2 changed. #3, #4, #5, #6 new.
  18.                Section II A:  #3 changed.
  19.                Section II B:  #2 changed. #3, #4, #5 new.
  20.                Section II C:  #1 new.
  21.                Section II D:  #1, #2, #3, #4 new.
  22.                Section II E:  #1 new.
  23.                Section II F:  #1, #2, #3, #4, #5 new.
  24.  
  25.      8/19/92:  All new.
  26.  
  27. =================================================
  28. Table of Contents:
  29. I    Issues
  30.      1.   Building MacApp 3.0.1 without a Pascal compiler.
  31.      2.   Problems with the MPW 3.2.3 C compiler.
  32.      3.   Using CatchFailures from Pascal.
  33.      4.   C compiler -opt nocse.
  34.      5.   ViewPromoter sometimes fails to promote views.
  35.      6.   Issues when using ResEdit to create menus for use
  36.                      in TPopups.
  37. II   Bugs (by Subject)
  38.      A.   SUB: Build Problems.
  39.           1.   INITLINKERSYMBOLS  offset out of range link
  40.                                 error with model far builds.
  41.           2.   ViewPromoter malfunction without recompiling.
  42.           3.   Problem Rezing MacApp.r with MPW 3.2.3 and
  43.                                 later Interfaces.
  44.      B.   SUB: View Problems.
  45.           1.   Problem with displaying dialogs, especially
  46.                               if created with ViewEdit.
  47.           2.   Problem with QuickTime movie controllers.
  48.           3.   IsGhostWindow and IsSystemWindow should be
  49.                                 resident.
  50.           4.   Problems with failures when reading 'View'
  51.                                 resources.
  52.           5.   TTEView miscalculates the page break if the
  53.                                 last character is a carriage-return.
  54.      C.   SUB: Printing Problems.
  55.           1.   Potential problems with non-standard page
  56.                 sizes or very large line heights.
  57.      D.   SUB: Menu Problems.
  58.           1.   Problems with having MENU and CMNU resources
  59.                           with the same ID's.
  60.           2.   Problems with multiple menus with the same
  61.                                 command number.
  62.           3.   ViewEdit Popups with "Use AddResMenu"
  63.                                 checked.
  64.           4.   TPopup::SetPopup malfunctions when called
  65.                                 from applications.
  66.      E.   SUB: Internationalization Problems.
  67.           1.   Problem in TKeySelectionBehavior.
  68.      F.   SUB: Other Problems.
  69.           1.   Bug in TTabber::Tab.
  70.           2.   Problem with TStream::WriteHandle and NULL
  71.                                 handles.
  72.           3.   Problems MacApp applications sending
  73.                                 AppleEvents to themselves.
  74.           4.   IsHandle function not compiled as universal
  75.                                 code.
  76.           5.   Failure handling bug in TApplication::PostAnEvent.
  77.  
  78. =================================================
  79. I    ISSUES:
  80.  
  81. -----------------------------------------
  82. 1.   Building MacApp 3.0.1 without a Pascal compiler.
  83.  
  84. To build the MacApp 3.0.1 libraries without the Pascal
  85. compiler, two files must be modified, "MacApp.lib.MAMake"
  86. (in the MacApp Libraries folder) and "Basic Definitions" (in
  87. the MacApp Tools folder).
  88.  
  89. In the file "MacApp.lib.MAMake" comment out the reference to
  90. UPascalTool in the  LibObjs section at the top of the file
  91. like this:
  92.  
  93. LibObjs = ∂
  94.      ...
  95.      "{ObjApp}UView.cp.o" ∂
  96.      "{ObjApp}UViewServer.cp.o" ∂
  97.      "{ObjApp}UWindow.cp.o" ∂
  98. #    "{ObjApp}UPascalTool.p.o" ∂   <--- comment out.
  99.      "{ObjApp}UFailure.a.o" ∂
  100.      "{ObjApp}UMemory.a.o" ∂
  101.  
  102. Then comment out the dependency list for UPascalTool itself.
  103. This is near the bottom of the file:
  104.  
  105. #"{ObjApp}UPascalTool.p.o" ƒ ∂
  106. #         "{SrcApp}UPascalTool.inc1.p" ∂
  107. #         "{MAPInterfaces}UList.p" ∂
  108. #         "{MAPInterfaces}MacAppTypes.p" ∂
  109. #         "{MAPInterfaces}UPascalObject.p" ∂
  110. #         "{MAPInterfaces}UObject.p" ∂
  111. #         "{MAPInterfaces}UAssociation.p" ∂
  112. #         "{MAPInterfaces}UFailure.p" ∂
  113. #         "{MAPInterfaces}UMacAppUtilities.p" ∂
  114. #         "{MAPInterfaces}UGeometry.p" ∂
  115. #         "{MAPInterfaces}UPatch.p" ∂
  116. #         "{MAPInterfaces}UMacAppGlobals.p" ∂
  117. #         "{PInterfaces}Types.p" ∂
  118. #         "{PInterfaces}Memory.p" ∂
  119. #         "{PInterfaces}TextEdit.p" ∂
  120. #         "{PInterfaces}Quickdraw.p" ∂
  121. #         "{PInterfaces}OSUtils.p" ∂
  122. #         "{PInterfaces}Editions.p" ∂
  123. #         "{PInterfaces}Files.p" ∂
  124. #         "{PInterfaces}SegLoad.p" ∂
  125. #         "{PInterfaces}Aliases.p" ∂
  126. #         "{PInterfaces}Dialogs.p" ∂
  127. #         "{PInterfaces}Windows.p" ∂
  128. #         "{PInterfaces}Events.p" ∂
  129. #         "{PInterfaces}Controls.p" ∂
  130. #         "{PInterfaces}AppleTalk.p" ∂
  131. #         "{PInterfaces}Notification.p" ∂
  132. #         "{PInterfaces}AppleEvents.p" ∂
  133. #         "{PInterfaces}EPPC.p" ∂
  134. #         "{PInterfaces}PPCToolbox.p" ∂
  135. #         "{PInterfaces}Processes.p" ∂
  136. #         "{PInterfaces}CursorCtl.p" ∂
  137. #         "{PInterfaces}Signal.p" ∂
  138. #         "{PInterfaces}PasLibIntf.p" ∂
  139. #         "{PInterfaces}IntEnv.p" ∂
  140. #         "{PInterfaces}ErrMgr.p" ∂
  141. #         "{PInterfaces}Packages.p" ∂
  142. #         "{PInterfaces}StandardFile.p" ∂
  143. #         "{PInterfaces}Script.p" ∂
  144. #         "{PInterfaces}Resources.p" ∂
  145. #         "{PInterfaces}Fonts.p"
  146.  
  147. By doing this the UPascalTool unit will not be built and
  148. Lib'ed into the MacApp library. The unit UPascalTool is only
  149. used to build MPW Tools in Pascal using MacApp (the
  150. MABuildTool is an example of this).
  151.  
  152. Next modify the file "Basic Definitions" by commenting out
  153. the three line as shown:
  154.  
  155. SystemSupport = ∂
  156.      "{Libraries}RunTime.o" ∂
  157.      "{CLibraries}StdCLib.o" ∂
  158. #    "{PLibraries}PasLib.o"        <---
  159.  
  160. NonFPUSANELib = ∂
  161.      "{CLibraries}CSANELib.o" ∂
  162. #    "{PLibraries}SANElib.o" ∂     <---
  163.      "{CLibraries}Math.o" ∂
  164.      "{CLibraries}Complex.o" ∂
  165.      "{CLibraries}CPlusLib.o"
  166.  
  167. FPUSANELib = ∂
  168.      "{CLibraries}CLib881.o" ∂
  169.      "{CLibraries}CSANELib881.o" ∂
  170. #    "{PLibraries}SANELib881.o" ∂  <---
  171.      "{CLibraries}Math881.o" ∂
  172.      "{CLibraries}Complex881.o" ∂
  173.      "{CLibraries}CPlusLib881.o"
  174.  
  175. Doing this will allow you to build without having Pascal
  176. installed in your MPW.
  177.  
  178. One other note, the CPlusExamples will not build because the
  179. variables {MacAppIntf} and {BuildingBlocksIntf} are used in
  180. their MAMake files. These variables are defined in Basic
  181. Definitions by the following lines:
  182.  
  183. # Leave in for compatibility (2.0)
  184. MacAppIntf = {MacAppPascalIntf}
  185.  
  186. # Leave in for compatibility (2.0)
  187. BuildingBlocksIntf = {BuildingBlocksPascalIntf}
  188.  
  189. If these variables are changed in the MAMake files to the
  190. following: {MacAppCPlusIntf} and {BuildingBlocksCPlusIntf}
  191. then the examples will build.  The programmer should use
  192. these variables in their MAMake files also.
  193. -----------------------------------------
  194.  
  195. 2.   Problems with the MPW 3.2.3 C compiler.
  196.  
  197. There is a code generation bug in the MPW 3.2.3 C compiler.
  198. This bug "appears" to effect MacApp only in the inline
  199. method CString::Delete.  This problem causes the default
  200. titles for new windows to be "Untitled-1>>>".  This problem
  201. is corrected in the MPW 3.2.4 C compiler.
  202. -----------------------------------------
  203.  
  204. 3.   Using CatchFailures from Pascal.
  205.  
  206. When using the CatchFailures routine from Object Pascal, you
  207. must use a failure handler that is a nested procedure. The
  208. reason for this is that CatchFailures does not check for a
  209. NIL staticLink (which you will get if the failure handler is
  210. a global routine).  In C++ this is not an issue, because you
  211. provide the staticLink manually.
  212.  
  213. -----------------------------------------
  214.  
  215. 4.   C compiler -opt nocse.
  216.  
  217. The Latest MPW C release notes for E.T.O. #9 and for
  218. E.T.O. #8 document C compiler problems with erroneous code
  219. generation that can occur during the compiler's attempted
  220. optimization of common sub-expressions. The release notes
  221. advise disabling these specific optimizations using the -opt
  222. nocse compiler option. Note that the C compiler will
  223. otherwise default to enabling these optimizations.
  224.  
  225. For MacApp programs -opt nocse can be automated by creating
  226. a new file (named something like "Startup˘Nocse" so that it
  227. executes after "Startup") in the "Startup Items" folder
  228. containing the following text:
  229.  
  230. SET MABuildDefaults "{MABuildDefaults} -C '-opt nocse'"
  231. EXPORT MABuildDefaults
  232.  
  233. This will avoid C compiler code gen problems with common sub-
  234. expression elimination.
  235.  
  236. -----------------------------------------
  237.  
  238. 5.   ViewPromoter sometimes fails to promote views.
  239.  
  240. ViewPromoter may fail to do some promotions. There are a
  241. number of things to try if this occurs. The first is to make
  242. ViewPromoter's memory partition very large. The second, if
  243. you have ViewPromoter 3.0b3 available from E.T.O. #6, is to
  244. attempt to use that version instead to do the promotions. It
  245. should also be given a very large memory partition in order
  246. to maximize its chances of accomplishing its task. If
  247. ViewPromoter 3.0b3 does succeed to promote views that failed
  248. to promote using the current version, then you should
  249. determine which specific views failed to promote using the
  250. current version, and use the earlier version of ViewPromoter
  251. to promote those views only. If neither version will do the
  252. promotion, please attempt to isolate only those views that
  253. fail to promote and submit them as a bug report to
  254. MACAPP.TEST. Note that ViewPromoter does not support custom
  255. views.
  256.  
  257. -----------------------------------------
  258.  
  259. 6.   Issues when using ResEdit to create menus for use in
  260. TPopups.
  261.  
  262. When using ResEdit to create menus for use in TPopups, you 
  263. must remember to set the menu-ID to match the resource
  264. ID.  You do this with the MENU command: "Edit Menu & MDEF
  265. ID…".
  266.  
  267. =================================================
  268.  
  269. II   BUGS (by subject):
  270.  
  271. A.   SUB: Build Problems:
  272. -----------------------------------------
  273.   1. INITLINKERSYMBOLS  offset out of range link error with
  274.   model far builds.
  275.   
  276.   There is a problem that can prevent successful linking
  277.   when specifying a -modelfar build. The problem is evident
  278.   in the InitLinkerSymbols PROC in UPascalObject.a. It
  279.   contains A5-relative references to SUPERCLASSTABLE,
  280.   CLASSTABLE, and SELECTORPROCTABLE such as
  281.   
  282.   LEA %_SUPERCLASSTABLE, A0
  283.   
  284.   which are later patched like this
  285.   
  286.   LEA *+xxxx,A0
  287.   
  288.   If any of these modules fall farther than 32K away from
  289.   the InitLinkerSymbols instructions that reference them, a
  290.   linker error will occur. If this happens the linker error
  291.   output might appear something like this:
  292.   
  293.     ### While reading file
  294.   "HD:MPW:MacApp:Libraries:.DebugSymFar:MacApp.lib"
  295.     ### Link: INITLINKERSYMBOLS (32712)
  296.     Reference to: %_SELECTORPROCTABLE in file:
  297.     ### Link: Error: PC-relative edit, offset out of range.
  298.   (Error 48)
  299.     INITLINKERSYMBOLS (32712)
  300.     Reference to: %_CLASSTABLE in file:
  301.     ### Link: Error: PC-relative edit, offset out of range.
  302.   (Error 48)
  303.   INITLINKERSYMBOLS (32712)
  304.     Reference to: INITLINKERSYMBOLS in file: ### Link:
  305.   Error: PC-relative edit,
  306.   offset out of range. (Error 48) INITLINKERSYMBOLS (32712)
  307.   
  308.   
  309.   
  310.   The following 3 changes to the UPascalObject.a file in
  311.   the MacApp:Libraries: folder fix this problem.
  312.   
  313.   In the definition of PROC InitLinkerSymbols, find the
  314.   line
  315.        If qModelFarCode then
  316.   
  317.   Following this line are 3 "LEA" instructions and 3
  318.   "MOVE.L" instructions.
  319.   By changing the form of the LEA instructions, they can be
  320.   changed into -model far references, and avoid the 32K
  321.   limit.  Make the following 3 changes...
  322.   
  323.      lea %_SUPERCLASSTABLE(A5),A0
  324.   becomes
  325.      lea (%_SUPERCLASSTABLE).L,A0
  326.   
  327.      lea %_CLASSTABLE(A5),A0
  328.   becomes
  329.      lea (%_CLASSTABLE).L,A0
  330.   
  331.   and
  332.   
  333.      lea %_SELECTORPROCTABLE(A5),A0
  334.   becomes
  335.      lea (%_SELECTORPROCTABLE).L,A0
  336.  
  337. -----------------------------------------
  338.   2. ViewPromoter malfunction without recompiling.
  339.   
  340.   A problem exists with ViewPromoter 3.0.1. ;  you may need
  341.   to recompile it in order to have it execute successfully.
  342.  
  343. -----------------------------------------
  344.   3. Problem Rezing MacApp.r with MPW 3.2.3 and later
  345.   Interfaces.
  346.   
  347.   A problem exists building MacApp 3.0.1 with MPW versions
  348.   3.2.3 or later.
  349.   In the MPW 3.2.3 Types.r interface file, the declaration
  350.   of the 'aedt' resource that had been used exclusively by
  351.   MacApp is no longer present. This resource declaration
  352.   should be, but is not, present in the MacAppTypes.r file.
  353.   To correct this problem, type the 'aedt' resource
  354.   declaration as it appears below in the MacAppTypes.r
  355.   file, at the end before the #endif. An alternate method
  356.   for this correction is to paste the resource there after
  357.   copying it from the Types.r file included with MPW 3.2.
  358.   Here is the resource declaration as it should appear in
  359.   your MacAppTypes.r file:
  360.   
  361.   /*------------------aedt ˘ Apple Events Template --------
  362.   ---------*/
  363.   /* Resource definition used for associating a value with
  364.   an apple event */
  365.   /* This really only useful for general dispatching */
  366.   
  367.   type 'aedt' {
  368.        wide array {
  369.        unsigned longint;   /* Event Class      */
  370.        unsigned longint;   /* Event ID    */
  371.        unsigned longint;   /* Value  */
  372.        };
  373.   };
  374.  
  375.   NOTE: This is fixed for you in MacApp 3.0.1˘ shipped on
  376.   ETO 9 (this is the only change between MacApp 3.0.1 and
  377.   MacApp 3.0.1˘).
  378.   
  379. =================================================
  380.  
  381. B.   SUB: View Problems:
  382. -----------------------------------------
  383.   1. Problem with displaying dialogs, especially if created
  384.   with ViewEdit.
  385.   
  386.   A drawback in ViewEdit 3.0.1 is that it does not provide
  387.   for behaviors and TDialogBehaviors in particular to be
  388.   specified. A work around for TDialogBehaviors is to fix
  389.   the bug in TWindow::PoseModally() that causes what would
  390.   otherwise be the automagic creation of the
  391.   TDialogBehavior not to take effect. If the following
  392.   lines in PoseModally
  393.   
  394.         TDialogBehavior* itsDialogBehavior = this-
  395.   >GetDialogBehavior();
  396.         IDType result = kNoIdentifier;
  397.         this->Open();
  398.         this->Select();
  399.   
  400.   are changed to
  401.   
  402.         TDialogBehavior* itsDialogBehavior;
  403.         IDType result = kNoIdentifier;
  404.         this->Open();
  405.         this->Select();
  406.         itsDialogBehavior = this->GetDialogBehavior();
  407.   
  408.   then the automagically created behavior is correctly
  409.   assigned to the window and functions correctly.
  410.   
  411.   Alternate  ways that you can get a behavior into a view
  412.   resource are to
  413.   - DeRez an existing view or create the view with Rez
  414.   initially; then specify a dialog behavior in the Rez text
  415.   format; then re-Rez, or
  416.   - create your TDialogBehavior or entire dialog
  417.   procedurally.
  418.  
  419. -----------------------------------------
  420.   2. Problem with QuickTime movie controllers.
  421.   
  422.   Incompatibilities exist between MacApp 3.0.1 and
  423.   QuickTime (1.0) movie controllers. To avoid these
  424.   problems use the forthcoming 1.5 version of QuickTime.
  425.  
  426. -----------------------------------------
  427.   3. IsGhostWindow and IsSystemWindow should be resident.
  428.   
  429.   In file "UWindow.cp", the global functions
  430.   "IsGhostWindow" and "IsSystemWindow" should be in segment
  431.   "MAWindowRes" rather than "MAWindowNonRes.
  432.   
  433.   This will avoid a segment load when these functions are
  434.   called from the window  manager patch to the trap
  435.   "_ShowHide".  The global function "InitUFloatWindow"
  436.   installs "MAShowHide" as a patch to "_ShowHide". The
  437.   global function "MAShowHide" calls MAFrontWindow.  The
  438.   global function "MAFrontWindow" calls the two functions
  439.   "IsGhostWindow" and "IsSystemWindow".  If a dialog box is
  440.   opened behind MacApp's back, the trap "_ShowHide" is
  441.   triggered which could cause the Segment Loader to crash.
  442.  
  443. -----------------------------------------
  444.   4. Problems with failures when reading 'View' resources.
  445.   
  446.   If a failure occurs during the reading in of a 'View' (or
  447.   'view') resource, then THandleStream::Free will truncate
  448.   the handle. This will guarantee a failure the next time
  449.   the application attempts to read this resource.  One
  450.   possible solution is to change the failure handler in
  451.   TViewServer::ReadViewsFromResource like this.
  452.   
  453.   Failure Handler:
  454.   
  455.   else                                        // Recover
  456.   {
  457.      itsViewStream = (TStream
  458.   *)FreeIfObject(itsViewStream);
  459.      firstView = (TView *)FreeIfObject(firstView);
  460.      fi.ReSignal();
  461.   }
  462.   
  463.   Change too:
  464.   
  465.   else                                        // Recover
  466.   {
  467.      ReleaseResource(((THandleStream*)itsViewStream)-
  468.   >fHandle);
  469.   
  470.      itsViewStream = (TStream
  471.   *)FreeIfObject(itsViewStream);
  472.      firstView = (TView *)FreeIfObject(firstView);
  473.      fi.ReSignal();
  474.   }
  475.   
  476.   We are not aware of any side affects cause by this at
  477.   this time.
  478.  
  479. -----------------------------------------
  480.   5. TTEView miscalculates the page break if the last
  481.   character is a carriage-return.
  482.   
  483.   TTEView::DoBreakFollowing will calculates the wrong line
  484.   count if the last character is a carriage-return.  This
  485.   results in the last page break not appearing until a
  486.   character is added to the last line.  The following fix
  487.   was sent in by a developer:
  488.   
  489.   pascal VCoordinate TMyTEView::DoBreakFollowing(VHSelect
  490.   vhs,
  491.                                    VCoordinate
  492.   previousBreak,
  493.                                    Boolean&
  494.   automatic)
  495.   {
  496.      VHSelect orthoVhs;
  497.      short possibleLoc;
  498.      TEStyleHandle theStyles;
  499.      LHHandle lhTab;
  500.      short height;
  501.      short lineHeight;
  502.      short lineNo;
  503.      short countLines;                        // !!! BUG-
  504.   FIX !!!
  505.      TPrintHandler* itsPrintHandler;
  506.   
  507.      orthoVhs = gOrthogonal[vhs];
  508.      automatic = TRUE;
  509.   
  510.      if (itsPrintHandler = this->GetPrintHandler())
  511.          possibleLoc = (short)Min(kMaxCoord, previousBreak
  512.   + itsPrintHandler->fViewPerPage[orthoVhs]); //!!! long-
  513.   >short
  514.   
  515.      // We want to get rid of the on-screen margin
  516.   represented
  517.      // by fMargin when printing, so
  518.       // adjust things so that the portion of the view
  519.   occupied
  520.      // by the screen margin doesn't get printed.
  521.   
  522.      if (previousBreak == 0)
  523.          possibleLoc += (short)fInset[topLeft][orthoVhs];
  524.      if ((fStyleType == kWithStyle) && (vhs == hSel))
  525.      {
  526.          if (fLastPageBreak == previousBreak)
  527.          {
  528.             height = fLastPageBreak;
  529.             lineNo = fLastLine;
  530.          }
  531.          else
  532.          {
  533.             height = (short)fInset[topLeft][orthoVhs];
  534.   lineNo = 0;
  535.          }
  536.   
  537.          theStyles = GetStylHandle(fHTE);
  538.          lhTab = (**theStyles).lhTab;
  539.   
  540.          // !!! BUG-FIX !!!
  541.   
  542.          countLines = (**fHTE).nLines;
  543.          if ((**fHTE).teLength > 0)
  544.          {
  545.             char lastChar =
  546.   (*(**fHTE).hText)[(**fHTE).teLength-1];
  547.             if (lastChar == chReturn)
  548.                 countLines++;
  549.          }
  550.   
  551.          while (lineNo < countLines)
  552.          {
  553.             lineHeight = (*lhTab)[lineNo].lhHeight;
  554.             if (height + lineHeight <= possibleLoc)
  555.                 height += lineHeight;
  556.             else
  557.                 break;
  558.             ++lineNo;
  559.          }
  560.   
  561.          if (lineNo >= countLines)
  562.             possibleLoc = (short)Max(possibleLoc, height);
  563.          else
  564.             possibleLoc = height;
  565.   
  566.          // !!! BUG-FIX !!!
  567.   
  568.          fLastPageBreak = possibleLoc;
  569.          fLastLine = lineNo;
  570.      }
  571.   
  572.      if ((possibleLoc+fInset[topLeft][orthoVhs]) >=
  573.   fSize[orthoVhs])
  574.          return fSize[orthoVhs];
  575.      else
  576.          return possibleLoc;
  577.   }   // TMyTEView::DoBreakFollowing
  578.  
  579. =================================================
  580. C.   SUB: Printing Problems:
  581. -----------------------------------------
  582.   1.   Potential problems with non-standard page sizes or
  583.   very large line heights.
  584.   
  585.   MacApp applications can hang when the chosen printer has
  586.   a "page height" less than the default (1") margins (such
  587.   as in the case of a label writer). Similar behavior can
  588.   occur if the height of a line exceeds the height of the
  589.   page (such as with a font size of 300, with 400%
  590.   magnification).
  591.  
  592. =================================================
  593. D.   SUB: Menu Problems:
  594. -----------------------------------------
  595.   1.   Problems with having a MENU and a CMNU resource with
  596.   the same ID.
  597.   
  598.   If a program has a MENU and a CMNU resource that have the
  599.   same ID's, MacApp may display the wrong menu.
  600.   
  601. -----------------------------------------
  602.   
  603.   2.  Problems with multiple menus with the same command
  604.   number.
  605.   
  606.   This was a change made to MacApp that broke the ability
  607.   to have multiple menus containing the same command
  608.   numbers (such as having multiple languages).  The change
  609.   is in TCmdTable::CommandToMenuItem.  The change was put
  610.   in to fix several performance problems related to typing
  611.   and selections in TTEViews.  If you need to use this
  612.   feature, a temporary fix is to change the
  613.   TCmdTable::CommandToMenuItem method to the following:
  614.   
  615. pascal void TCmdTable::CommandToMenuItem(CommandNumber
  616. theCommand,
  617.                                   short& menu,
  618.                                   short& item)
  619. {
  620.    if (theCommand < 0) // negative commands are mapped not
  621. table based
  622.    {
  623.        menu = (short)((-theCommand) >> 8);
  624.        item = (short)((-theCommand) & 255);
  625.    }
  626.    else
  627.    {
  628.        // Assume not found
  629.        menu = 0;
  630.        item = 0;
  631.  
  632.        // Search the table linearly.
  633.        for (ArrayIndex i = 1; i <= this->GetSize(); ++i)
  634.        {
  635.            MenuCmdRecordPtr aMenuCmdRecordPtr =
  636. (MenuCmdRecordPtr)this->ComputeAddress(i);
  637.            if( theCommand == aMenuCmdRecordPtr->theCmdNumber
  638. )
  639.            {
  640.                menu = aMenuCmdRecordPtr->theMenuNumber;
  641.                item = aMenuCmdRecordPtr->theItemNumber;
  642.  
  643.                // Return the first menu in the menu bar or
  644. the last menu not in any menu bar
  645.                if( GetMHandle( aMenuCmdRecordPtr-
  646. >theMenuNumber ) != NULL )
  647.                   break;
  648.            }
  649.        }
  650.    }
  651. } // TCmdTable::CommandToMenuItem
  652.   
  653.   Be aware that this may induce some performance slow downs
  654.   involving TTEViews, and therefore TEditTexts (one example
  655.   is double click selections of words in a TTEView).
  656.   
  657. -----------------------------------------
  658.   
  659.   3. ViewEdit Popups with "Use AddResMenu" checked.
  660.   
  661.   It is not possible to have a TPopup created by resource
  662.   and use the AddResMenu-Feature of this class (e.g. a Font-
  663.   Popup used in a Dialog). The problem is that everytime
  664.   the Popup is created, it calls AddResMenu and adds, lets
  665.   say all the FOND-Resource-Names to the menu. Because
  666.   TPopup does not revert the Menu when it is disposed,
  667.   opening the Dialog again has the effect of duplicating
  668.   the Menu-Items (it grows, and grows, and grows… everytime
  669.   you open the dialog). The only workaround currently
  670.   recommended for this problem is to create the popup
  671.   either procedurally using something like
  672.   
  673.   aPopup = new TPopup;
  674.   aPopup->IPopup(...);
  675.   
  676.   or dynamically using something like
  677.   
  678.   fMenuHandle = NewMenu(kDynamicPopup, "Fonts:");
  679.   MAInsertInMenuTable(fMenuHandle, kDynamicPopup);
  680.   .
  681.   .
  682.   .
  683.   TMyApplication::DoSetupMenus()
  684.   {
  685.   .
  686.   .
  687.   .
  688.   // If the Dynamic menu is not in the menubar then insert
  689.   it
  690.   if (GetMHandle((*fMenuHandle)->menuID) == NULL)
  691.      MAInsertMenu(fMenuHandle, (*fMenuHandle)->menuID, -1);
  692.   }
  693.   
  694. -----------------------------------------
  695.  
  696.   4.   TPopup::SetPopup malfunctions when called from
  697.   applications.
  698.   
  699.   Avoid using TPopup::SetPopup from applications to switch
  700.   the menu associated with a given TPopup. That feature of
  701.   TPopup is really unstable and should not have been
  702.   included in the public interface of the class. The
  703.   problem is that the Popup class is implemented on top of
  704.   System 7's Popup CDEF which maintains private references
  705.   to the menu handle. As with all other "private" data in
  706.   the toolbox the implementation could change with System
  707.   version 7.1, 7.2... and any class would break that
  708.   depended on the "private" data of the Toolbox structures.
  709.   
  710.   It is instead recommend to put multiple TPopup instances
  711.   in your dialog and show only whichever one is appropriate
  712.   given the context of the UI.
  713.  
  714. =================================================
  715. E.   SUB: Internationalization Problems:
  716. -----------------------------------------
  717.   1.   Problem in TKeySelectionBehavior.
  718.   
  719.   There is a problem with the way the TKeySelectionBehavior
  720.   does its character masking.  It checks to see if the
  721.   character value is in the range:
  722.   "0x21 to 0x7E".  This is not valid for many non-english
  723.   systems. Initial investigation indicates that a (at least
  724.   partial) solution would be to change the test to be:
  725.   "greater than 0x20 and not equal to 0x7F".  The resulting
  726.   code would look something like this:
  727.   
  728.   pascal void TKeySelectionBehavior::DoKeyUp(TToolboxEvent*
  729.   event)
  730.   {
  731.      if (event->IsOptionKeyPressed() || event-
  732.   >IsControlKeyPressed()
  733.          || event->fCharacter < 0x20 || event->fCharacter
  734.   == 0x7F)
  735.          inherited::DoKeyUp(event);
  736.      else
  737.          fLastKeyUpTime = event->fEventRecord.when;
  738.   } // TKeySelectionBehavior::DoKeyUp
  739.   
  740.   The test in TKeySelectionBehavior::DoKeyEvent also needs
  741.   to be similarly modified.
  742.  
  743. =================================================
  744. F.   SUB: Other Problems:
  745. -----------------------------------------
  746.   1.   Bug in TTabber::Tab.
  747.   
  748.   In file "UTabBehaviors.cp", the method TTabber::Tab
  749.   always calls "SetTargetSelection" of the next target even
  750.   if the target refuses to become a target.  This could
  751.   happen if the next target's "WillingToResignTarget"
  752.   method has been overridden and returns false.  The
  753.   suggested code for TTabber::Tab is:
  754.   
  755.   //-------------------------------------------------------
  756.   ------------
  757.   // TTabber::Tab:
  758.   //-------------------------------------------------------
  759.   ------------
  760.   #pragma segment MATabBehaviorRes
  761.   
  762.   pascal void TTabber::Tab(Boolean tabBackward)
  763.   {
  764.        this->Reset();
  765.   
  766.        this->FindTargets(tabBackward);
  767.        if (fNext == NULL)
  768.             fNext = fFirst;
  769.        if (fNext)
  770.        {
  771.             if ( fNext->BecomeTarget() )
  772.             {
  773.                  fNext->SetTargetSelection(kRedraw);
  774.             }
  775.        }
  776.   }     // TTabber::Tab
  777.   
  778. -----------------------------------------
  779.   2.   Problem with TStream::WriteHandle and NULL handles.
  780.   
  781.   In file "UStream.cp", method "TStream::WriteHandle" will
  782.   crash if a NULL is passed as the handle.  If
  783.   "WriteHandle" were to handle this case, it would have to
  784.   write something to the stream so that "ReadHandle" would
  785.   recognize this situation and return a NULL.  One solution
  786.   would be for "WriteHandle" to write "kMaxLong" as the
  787.   size of the handle and not write a handle.  Then
  788.   "ReadHandle" would check for a value of "kMaxLong" as the
  789.   handle size, not read a handle and return NULL.  The code
  790.   would look like:
  791.   
  792.   //-------------------------------------------------------
  793.   ------------
  794.   // TStream::WriteHandle:
  795.   //-------------------------------------------------------
  796.   ------------
  797.   #pragma segment MAStreamWrite
  798.   
  799.   pascal void TStream::WriteHandle(const Handle aHandle)
  800.   {
  801.        if ( aHandle )
  802.        {
  803.             // write the size of the handle
  804.             Size itsSize = GetHandleSize(aHandle);
  805.             this->WriteLong(itsSize);
  806.   
  807.             // write the contents of the handle
  808.             SignedByte savedState = HGetState(aHandle);
  809.             HLock(aHandle);
  810.             FailMemError();
  811.             this->WriteBytes(*aHandle, itsSize);
  812.             HSetState(aHandle, savedState);
  813.        {
  814.        else
  815.             this->WriteLong(kMaxLong);    // kMaxLong means
  816.   NULL handle
  817.   
  818.   } // TStream::WriteHandle
  819.   
  820.   //-------------------------------------------------------
  821.   ------------
  822.   // TStream::ReadHandle:
  823.   //-------------------------------------------------------
  824.   ------------
  825.   #pragma segment MAStreamRead
  826.   
  827.   pascal Handle TStream::ReadHandle()
  828.   {
  829.        Handle aHandle = NULL;
  830.        VOLATILE(aHandle);
  831.   
  832.        // read the size of the handle in from the stream
  833.        Size itsSize = this->ReadLong();
  834.   
  835.        if ( itsSize != kMaxLong )    // kMaxLong means
  836.   return NULL handle
  837.        {
  838.   
  839.             // read the handle in from the stream
  840.             FailInfo fi;
  841.             if (fi.Try())
  842.             {
  843.                  // allocate the handle
  844.                  aHandle = NewPermHandle(itsSize);
  845.   
  846.                  // lock the handle and read into it from
  847.   the stream
  848.                  SignedByte savedState =
  849.   HGetState(aHandle);
  850.                  HLock(aHandle);
  851.                  FailMemError();
  852.                  this->ReadBytes(*aHandle, itsSize);
  853.                  HSetState(aHandle, savedState);
  854.   
  855.                  fi.Success();
  856.             }
  857.             else // Recover
  858.             {
  859.                  aHandle = DisposeIfHandle(aHandle);
  860.                  fi.ReSignal();
  861.             }
  862.        }
  863.        return aHandle;
  864.   
  865.   } // TStream::ReadHandle
  866.   
  867. -----------------------------------------
  868.   3.   Problems MacApp applications sending AppleEvents to
  869.   themselves.
  870.   
  871.   MacApp applications can get stuck waiting for a reply
  872.   from themselves if they send an AppleEvent to themselves.
  873.   This can be a problem for those trying to provide full
  874.   support for AppleScript.  For more information on this
  875.   problem, refer to the MacApp3Tech$ archives and the
  876.   October 92 technote from DTS ("Getting in Touch with
  877.   Yourself Via the AppleEvents Manager").
  878.   
  879. -----------------------------------------
  880.   4.   IsHandle function not compiled as universal code.
  881.   
  882.   The IsHandle function is not compiled as universal code,
  883.   therefore applications built with the -Debug and -
  884.   NeedsMC68020 options will crash on 68000 on launch.  The
  885.   fix is to bracket the function (in UMacAppUtilities.cp)
  886.   with:
  887.   
  888.   #pragma push
  889.   #pragma processor 68000
  890.   #pragma segment MAUtilitiesRes
  891.   
  892.   pascal Boolean IsHandle(Handle h)
  893.   {
  894.        ...
  895.   } // IsHandle
  896.   
  897.   #pragma pop
  898.   
  899. -----------------------------------------
  900.   5.   Failure handling bug in TApplication::PostAnEvent.
  901.   
  902.   There is a problem that can occur in
  903.   TApplication::PostAnEvent if a failure occurred.  The
  904.   problem is that in the event of failure by
  905.   TEvent::IsReadyToPost, the Boolean variable "oldPerm"
  906.   would be used by the failure handler in the call to
  907.   PermAllocation, but the variable is not yet set!  This
  908.   can often occur in TClientCommand::IsReadyToPost.
  909.   
  910.   The solution is to override the method
  911.   TApplication::PostAnEvent like this:
  912.   
  913.   pascal void TApplication::PostAnEvent(TEvent* event)//
  914.   Override
  915.   {
  916.      Boolean oldPerm;
  917.      VOLATILE(oldPerm);
  918.   
  919.      FailInfo fi;
  920.      if (fi.Try())
  921.      {
  922.          oldPerm = PermAllocation(FALSE);
  923.          if (event->IsReadyToPost())
  924.          {
  925.             fEventList->Insert(event);   // inserts event
  926.          }
  927.          PermAllocation(oldPerm);
  928.          fi.Success();
  929.      }
  930.      else
  931.      {
  932.          PermAllocation(oldPerm);
  933.          if (event->ShouldFreeOnCompletion())
  934.             event = (TEvent*)FreeIfObject(event);
  935.          fi.ReSignal();
  936.      }
  937.   } // TApplication::PostAnEvent
  938.   
  939.